<?php
    class Admin_Model_Similar extends Zend_Db_Table_Abstract
    {
        protected $_name = 'similar';
      //  protected $_primary = 'role_id';
        protected $_db;
        
        public function __construct(){
            $this->_db = Zend_Registry::get('db');
        }
        
        public function insertSimilar($data)
        {   
            
            
            $sql=$this->_db->insert('similar',$data);
            
        }
        
        public function addSimilar($tour1,$tour2,$point)
        {
            $data=array(
                'tour_1'=>$tour1,
                'tour_2'=>$tour2,
                'point'=>$point
            
            );
            $sql=$this->_db->insert('similar',$data);
        }
        
        public function deleteSimilar($tour_id) {
            $where = $this->getAdapter()->quoteInto('tour_1 = ?', $tour_id);
            $this->_db->delete($this->_name, $where);
            $where = $this->getAdapter()->quoteInto('tour_2 = ?', $tour_id);
            $this->_db->delete($this->_name, $where);
        }
    }
